package demo1;

import java.util.Stack;

public class Test {

    public static void main4(String[] args) {
        MySingleList mySingleList = new MySingleList();
        mySingleList.addLast(1);
        mySingleList.addLast(1);
//        mySingleList.addLast(3);
//        mySingleList.addLast(4);
        mySingleList.addLast(1);
        mySingleList.addLast(1);
        //mySingleList.addLast(5);
        mySingleList.addLast(1);
        mySingleList.addLast(1);
        mySingleList.display();
        mySingleList.removeAllKey(1);
        mySingleList.display();
    }

    public static void main(String[] args) {
        MySingleList mySingleList = new MySingleList();
        mySingleList.addIndex(0, 1);
        //mySingleList.addLast(1);
        mySingleList.addLast(2);
        mySingleList.addLast(3);
        mySingleList.addLast(4);
        mySingleList.addLast(5);
        mySingleList.display3();

//        mySingleList.remove(90);
//        mySingleList.display();

//        mySingleList.addIndex(0, 99);
//        mySingleList.display();
//
//        mySingleList.addIndex(6, 98);
//        mySingleList.display();

//        try {
//            mySingleList.addIndex(90, 97);
//        }catch (MySingleListIndexOutOfException e) {
//            e.printStackTrace();
//        }
    }

    public static void main2(String[] args) {
        MySingleList mySingleList = new MySingleList();
        mySingleList.addFirst(1);
        mySingleList.addFirst(2);
        mySingleList.addFirst(3);
        mySingleList.addFirst(4);
        mySingleList.addFirst(5);
        mySingleList.display();
    }

    public static void main1(String[] args) {
        MySingleList mySingleList = new MySingleList();
        mySingleList.create();
        mySingleList.display();
        System.out.println("===============");
        System.out.println(mySingleList.contains(11));
        System.out.println(mySingleList.size());
    }
}
